// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import Mint from 'mint-ui';
import App from './App.vue';
import router from './router';
import 'mint-ui/lib/style.css';
import '../static/css/global.css'; /*引入公共样式*/
import '../static/css/iconfont.css';
import axios from 'axios';
import { Toast } from 'mint-ui';
import fingerprint from 'fingerprintjs';
import $ from 'jquery';
// import '../static/epub/epub.min';

Vue.prototype.$http = axios;

//挂载时间
Vue.prototype.formatDate = function(time) {
	const date = new Date(time);
	const year = date.getFullYear(),
		month = date.getMonth() + 1,
		day = date.getDate(),
		hour = date.getHours(),
		min = date.getMinutes(),
		sec = date.getSeconds();
	const newTime = year + '-' +
		(month < 10 ? '0' + month : month) + '-' +
		(day < 10 ? '0' + day : day) + ' ' +
		(hour < 10 ? '0' + hour : hour) + ':' +
		(min < 10 ? '0' + min : min) + ':' +
		(sec < 10 ? '0' + sec : sec);
	return newTime;
};

//挂载时间戳转化格式
Vue.prototype.timestampToTime = function(timestamp) {
	var date = new Date(timestamp); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
	var Y = date.getFullYear();
	var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
	var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
	return Y + M + D;
};

import { InfiniteScroll } from 'mint-ui';

Vue.use(InfiniteScroll);

Vue.use(Mint);

Vue.config.productionTip = false;

/* eslint-disable no-new */
new Vue({
	el: '#app',
	router,
	components: {
		App
	},
	template: '<App/>'
})